package com.studyhub.api.problem.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 评论展示VO
 * 
 * @author StudyHub Team
 */
@Data
@Schema(name = "CommentVO", description = "评论展示信息")
public class CommentVO {

    @Schema(description = "评论ID")
    private Long id;

    @Schema(description = "评论目标类型：1-问题，2-回答")
    private Integer targetType;

    @Schema(description = "评论目标ID")
    private Long targetId;

    @Schema(description = "评论用户ID")
    private Long userId;

    @Schema(description = "评论用户昵称")
    private String userNickname;

    @Schema(description = "评论用户头像")
    private String userAvatar;

    @Schema(description = "父评论ID")
    private Long parentId;

    @Schema(description = "评论内容")
    private String content;

    @Schema(description = "点赞数量")
    private Integer likeCount;

    @Schema(description = "当前用户是否已点赞")
    private Boolean isLiked;

    @Schema(description = "子评论列表")
    private List<CommentVO> children;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;
}
